Public Class frmNamedValue

    Private _name As String
    Private _value As Integer

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        _name = txtName.Text
        _value = numValue.Value
        Me.Hide()
    End Sub

    Public ReadOnly Property ItemName() As String
        Get
            Return _name
        End Get
    End Property

    Public ReadOnly Property ItemValue() As Integer
        Get
            Return _value
        End Get
    End Property

End Class